/* 
 * Contenedor con pestañas del entorno.
 */
Ext.define('KMA.view.environment.TabContainer',{
    extend: 'Ext.tab.Panel',
    alias: 'widget.environmenttabcontainer',
    
    initComponent: function(){
        this.border = '0 0 0 0';
        this.defaults = {
            border: false,
            layout: 'fit',
            closable: true
        };
        this.items = [
            {
                title: 'Bienvenido',
                itemId: 'BienvenidoTag',
                tabConfig: {
                    title: 'Inicio',
                    tooltip: 'Pantalla de inicio',
                    
                }
            }
        ];
        
        this.callParent(arguments);
    },
    createTab: function(aTitle,aToolTip,anItem){
        return {
            title: aTitle,
            itemId: aTitle + "Tag",
            items: anItem,
            tabconfig: {
                title: aTitle,
                tooltip: aToolTip
            }    
        };
    },
    openTabs: function(){
        return this.items.length;
    },
    maxOpenTabs: function(){
        return 7;
    },
    lastTab: function(){
        return this.items[this.openTabs()];
    },
    canAddTab: function(){
        return (this.openTabs() < this.maxOpenTabs());
    },
    addTab: function(aTabCfg){
        this.add(aTabCfg).show();
    }
});